package com.skycong.hello77.activity.common;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.skycong.hello77.R;

import java.util.List;

/**
 * Created by Kiki on 2018/5/23.
 */

public class MyBaseAdapter extends BaseAdapter {
    private List<String> list;
    private LayoutInflater inflater;//布局装载器对象
    public  MyBaseAdapter(Context context,List<String> list){
        this.list = list;
        this.inflater  = LayoutInflater.from(context);
    }
    //返回ListView需要显示的数据量
    @Override
    public int getCount() {
        return list.size();
    }

    //取出对应的索引
    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    //返回每一项的显示内容
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        //将xml布局转换成View对象
       View view  = inflater.inflate(R.layout.infalte_listview_item,null);
        return null;
    }
}
